<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Desktop - jQuery EasyUI</title>
	<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
	<link rel="stylesheet" type="text/css" href="desktop.css">
	<script type="text/javascript" src="../../jquery.min.js"></script>
	<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../../locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="jquery.desktop.js"></script>
	<script type="text/javascript">
		$(function(){
			// 检查全局登录token
			var token = sessionStorage.getItem('token');
			if (token == null || token.length <= 0) {
				$.messager.alert({
					title: '提示',
					msg: '未登录或登录已失效！',
					fn: function() {
						window.location.href = '../../index.html';
					}
				});
				return;
			}

			$('body').desktop({
				apps: [{
					name: '我的电脑',
					icon: 'images/computer.png',
					width: 800,
					height: 400,
					left: 200,
					top: 50,
					href: '_layout.html'
				},{
					name: '网络邻居',
					icon: 'images/network.png',
					left: 300,
					top: 100
				},{
					name: '监控中心',
					icon: 'images/monitor.png',
					left: 400,
					top: 150
				}],
				menus: [{
					text: '关于桌面',
					handler: function(){
						$('body').desktop('openApp', {
							icon: 'images/win.png',
							name: 'About',
							width: 400,
							height: 200,
							href: '_about.html'
						})
					}
				},{
					text: '系统更新...',
					handler: function(){
						$('body').desktop('openApp', {
							name: '系统更新'
						})
					}
				},{
					text: 'Recent Items',
					menus: [{
						text: 'Activity Monitor'
					},{
						text: 'FaceTime',
						menus: [{
							text: 'FaceTime 1'
						},{
							text: 'FaceTime 2',
							menus: [{
								text: 'FaceTime 21'
							},{
								text: 'FaceTime 22'
							},{
								text: 'FaceTime 23'
							}]
						}]
					},{
						text: 'Mail',
						menus: [{
							text: 'Mail 1'
						},{
							text: 'Mail 2'
						}]
					},{
						text: 'Preview'
					}]
				},{
					text: '帮助',
					iconCls: 'icon-help',
					handler: function(){
						$('body').desktop('openApp', {
							name: '帮助中心'
						})
					}
				},{
					text: '退出',
					iconCls: 'icon-lock',
					handler: function(){
						$.messager.confirm({
							title:'提示',
							msg:'你确定要退出系统吗?',
							fn: function (r) {
								if (r) {
									$.messager.alert('提示', '退出成功，跳转中...');
									setTimeout(function() {
										window.location.href = '../../index.html';
									}, 2000);
								}
							}
						})
					}
				}],
				buttons: '#buttons'
			})
		});
	</script>
</head>
<body>
</body>
</html>